<template>
  <div>
        <navbar @toDiv="toDiv" :logo="logo" :menu="menu"></navbar>
        <pageblock7 name="home" ref="home"></pageblock7>
        <div id="main-content">
          <pageblock8></pageblock8>
          <pageblock3></pageblock3>
          <pageblock4 name="knowledgeSchool" ref="knowledgeSchool"></pageblock4>
          <pageblock5 name="answer" ref="answer"></pageblock5>
          <pageblock6></pageblock6>
        </div>
        <div class="backToTop hidden-xs" style="display: none;" @click="toTop">
          <div>回到<br>顶部</div>
        </div>
  </div>


</template>

<script>
    import  Navbar  from './components/Navbar'
    import  pageblock1  from './components/pageblock1'
    import  pageblock2  from './components/pageblock2'
    import  pageblock3  from './components/pageblock3'
    import  pageblock4  from './components/pageblock4'
    import  pageblock5  from './components/pageblock5'
    import  pageblock6  from './components/pageblock6'
    import  pageblock7  from './components/pageblock7'
    import  pageblock8  from './components/pageblock8'
    export default {
        name: "index",
      data(){
          return{
            logo:'../../../../static/images/logo.png',
            menu:[
              {label:'在线测试',labelType:'text',url:'home',linkType:1,children:[]},
              {label:'爱眼课堂',labelType:'text',url:'knowledgeSchool',linkType:1,children:[]},
              {label:'专家&A',labelType:'text',url:'answer',linkType:1,children:[]},
              { label:'合作伙伴',
                labelType:'text',
                url:'#',
                linkType:1,
                children:[
                  {label:'../../../../static/images/main-content-top-scroll-down-1.jpg',labelType:'img',url:'http://www.gzzoc.com/',linkType:2},
                  {label:'../../../../static/images/main-content-top-scroll-down-3.jpg',labelType:'img',url:'',linkType:3}
                ]
              },
            ]
          }
      },
        created(){

        },
      components: {
        Navbar,
        pageblock1,
        pageblock2,
        pageblock3,
        pageblock4,
        pageblock5,
        pageblock6,
        pageblock7,
        pageblock8,
      },
      methods:{
        toTop(){
          event.preventDefault();
          $('html, body').animate({scrollTop: 0}, 1000);
        },
        toDiv(name){
          this.$refs[name].toDiv()
        },
      },
    }
</script>


<style scoped>
</style>
